<ui:composition template="/WEB-INF/templates/main-template.xhtml"
	xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">
	
	<ui:define name="sidebar">
		<ui:include src="/WEB-INF/templates/public-sidebar.xhtml" />
	</ui:define>
	<ui:define name="content">
	<h:outputText value="View Skill Matrix" styleClass="outputTextTitle" /> 
	<h:form>
	<p:growl/>
			
	 <p:panel header="View Employee Skills"> 
		 

             <h:panelGrid columns="3"  columnClasses="gridCellMiddleLeftAligned, gridCellMiddleRightAligned"> 
             	
					 <h:outputLabel value="Select" />
			         <h:outputLabel value=":" />		
					 <p:menuButton value="#{viewEmployeeSkillsBean.selectedButton}">
					 <p:menuitem value="Under Your Competency" actionListener="#{viewEmployeeSkillsBean.buttonChangeListner}" update="@form"></p:menuitem>
					 <p:menuitem value="All Employees Skills" actionListener="#{viewEmployeeSkillsBean.buttonChangeListner}" update="@form"></p:menuitem> 
					
					</p:menuButton>
             </h:panelGrid>	
             
             <h:panelGrid rendered="#{viewEmployeeSkillsBean.skillsListRender}">
             
             <!-- COMPETENCY EMPLOYEE SKILLS LIST -->
             <p:dataTable value="#{viewEmployeeSkillsBean.competencySkilsList}" var="employeeSkill" rendered="#{viewEmployeeSkillsBean.selectedButton eq 'Under Your Competency'}" paginator="true" rows="25">  
	  
		            <p:column headerText="S.No"> 
		                <h:outputText value="#{employeeSkill.sNo}" />
		            </p:column>  
		            
		            <p:column headerText="Employee Code"> 
		                <h:outputText value="#{employeeSkill.employee.employeeCode}" />
		            </p:column>  
		  
		            <p:column headerText="Employee Name"> 
		                <h:outputText value="#{employeeSkill.employee.firstName} #{allEmpSkills.employee.lastName}" />  
		            </p:column> 
		            
		            <p:column headerText="Department">
		                <h:outputText value="#{employeeSkill.employee.moduleName}" />  
		            </p:column>  
		            
		            <p:column headerText="Designation">
		                <h:outputText value="#{employeeSkill.employee.designation}" />  
		            </p:column>  
		            
		            <p:column headerText="Last Update Date">
		                <h:outputText value="#{employeeSkill.createDate}" > 
		                	<f:convertDateTime pattern="dd-MMM-yyyy"/>
		                </h:outputText>
		            </p:column> 
		            
		            <p:column headerText="Email to Employee">						
						<p:commandButton  icon="ui-icon-mail-closed" value="Mail" oncomplete="emailConfirmationDiaglog.show()" actionListener="#{viewEmployeeSkillsBean.renderEmailConfirmDialog}" >
								<f:attribute name="employeeId" value="#{employeeSkill.employee.employeeId}"></f:attribute>											
						</p:commandButton>
					</p:column>
		            
					<p:column style="width: 66px; text-align: center;">						
						<p:commandButton icon="ui-icon-search" action="#{viewEmployeeSkillsBean.viewOrEditSkillMatrix}" oncomplete="dialog.show()" update="@form">
							<f:setPropertyActionListener target="#{viewEmployeeSkillsBean.employeeSkillMatrix}" value="#{employeeSkill}"></f:setPropertyActionListener>
						</p:commandButton>
					</p:column>
		          
	            </p:dataTable>  
	            
	            
	            <p:confirmDialog widgetVar="emailConfirmationDiaglog" id="emailConfirmationDiaglog" severity="alert" message="Do you want to send email to employee ?">
					<h:panelGroup style="text-align: right; float: right;">
						<p:commandButton value="Yes, Send Email"  actionListener="#{viewEmployeeSkillsBean.sendMail}" update="@form" onclick="emailConfirmationDiaglog.hide()" oncomplete="mailStatusDialog.show()">
						</p:commandButton>
						<p:commandButton id="cancel" value="Cancel" onclick="emailConfirmationDiaglog.hide()" type="button" />
					</h:panelGroup>
			    </p:confirmDialog>
	            
	            <!-- ALL EMPLOYEE SKILL MATRIX LIST TABLE -->
	            
	             <p:dataTable paginator="true" rows="25" value="#{viewEmployeeSkillsBean.allEmpSkilsList}" var="allEmpSkills" rendered="#{viewEmployeeSkillsBean.selectedButton eq 'All Employees Skills' }">  
	  
		            <p:column headerText="S.No"> 
		                <h:outputText value="#{allEmpSkills.sNo}" />
		            </p:column> 
		            
		            <p:column headerText="Employee Code"> 
		                <h:outputText value="#{allEmpSkills.employee.employeeCode}" />
		            </p:column>  
		  
		            <p:column headerText="Employee Name"> 
		                <h:outputText value="#{allEmpSkills.employee.firstName} #{allEmpSkills.employee.lastName}" />  
		            </p:column> 
		            
		            <p:column headerText="Department">
		                <h:outputText value="#{allEmpSkills.employee.moduleName}" />  
		            </p:column>  
		            
		            <p:column headerText="Designation">
		                <h:outputText value="#{allEmpSkills.employee.designation}" />  
		            </p:column>  
		            
		            <p:column headerText="Last Update Date">
		                <h:outputText value="#{allEmpSkills.createDate}" > 
		                	<f:convertDateTime pattern="dd-MMM-yyyy"/>
		                </h:outputText>
		            </p:column> 
		            
					<p:column style="width: 66px; text-align: center;">						
						<p:commandButton icon="ui-icon-search" action="#{viewEmployeeSkillsBean.viewOrEditSkillMatrix}" oncomplete="dialog.show()" update="@form">
							<f:setPropertyActionListener target="#{viewEmployeeSkillsBean.employeeSkillMatrix}" value="#{allEmpSkills}"></f:setPropertyActionListener>
						</p:commandButton>
					</p:column>
	  
	            </p:dataTable>  
	            
             </h:panelGrid>
             
            <!-- DIALOG BOX CODE -->
	<p:dialog widgetVar="dialog" resizable="false"  header="View  #{viewEmployeeSkillsBean.employeeSkillMatrix.employee.firstName} #{viewEmployeeSkillsBean.employeeSkillMatrix.employee.lastName} - Skills Details">
			<p:scrollPanel style="height: 500px; width:700px; padding: 0; margin: 0; " mode="native">  	
			<h:panelGrid id="dialogContent"  >  
	          <p:panel header="#{msg['employeedetails.label']}"> 
	             <h:panelGrid style="width: 100%" cellspacing="8" columns="6" columnClasses="employeeDetailLabel,gridCellMiddleLeftAligned, employeeDetailText, employeeDetailLabel,gridCellMiddleLeftAligned, employeeDetailText">		       			
				    <h:outputLabel value="#{msg['employeename.label']}"/>
				    <h:outputLabel value=":"/>
					<h:outputLabel value="#{viewEmployeeSkillsBean.employeeSkillMatrix.employee.firstName} #{viewEmployeeSkillsBean.employeeSkillMatrix.employee.lastName}"/>
					<h:outputLabel value="Employee Code"/>
					<h:outputLabel value=":"/>
					<h:outputLabel value="#{viewEmployeeSkillsBean.employeeSkillMatrix.employee.employeeCode}"/>
					 
					<h:outputLabel value="#{msg['designation.label']}"/>
					<h:outputLabel value=":"/>
					<h:outputLabel value="#{viewEmployeeSkillsBean.employeeSkillMatrix.employee.designation}" />
					<h:outputLabel value="#{msg['contactnumber.label']}"/>
					<h:outputLabel value=":"/>
					<h:outputLabel value="#{viewEmployeeSkillsBean.employeeSkillMatrix.employee.telephone}" />				
					
					<h:outputLabel value="Qualification" />
					<h:outputLabel value=":"/>
					<h:outputLabel value="#{viewEmployeeSkillsBean.employeeSkillMatrix.qualification}" />
					<h:outputLabel value="Last Update On" />
					<h:outputLabel value=":"/>
					<h:outputText value="#{viewEmployeeSkillsBean.employeeSkillMatrix.createDate}" >
						<f:convertDateTime pattern="dd-MM-yyyy HH:mm a"/>
					</h:outputText>
			     </h:panelGrid>
		      </p:panel> 
		 
			  <p:panel header="Skills" > 
			     <h:panelGrid  columns="3" cellspacing="8" columnClasses="employeeDetailLabel,gridCellMiddleLeftAligned, employeeDetailText">
			 
		       		<h:outputLabel value="Type "/>
		       		<h:outputLabel value=":"/>
					<h:outputLabel value="#{viewEmployeeSkillsBean.employeeSkillMatrix.sapSkillType}" />
					
					<h:outputLabel value="Primary Skills "/>
					<h:outputLabel value=":"/>
					<h:outputLabel   value="#{viewEmployeeSkillsBean.employeeSkillMatrix.primarySkills}"/>
					
					<h:outputLabel value="Secondary Skills" />
					<h:outputLabel value=":"/>
					<h:outputLabel  value="#{viewEmployeeSkillsBean.employeeSkillMatrix.secondarySkills}"/>
					
					<h:outputLabel value="Non-SAP /Domain Skills " />
					<h:outputLabel value=":"/>
					<h:outputLabel  value="#{viewEmployeeSkillsBean.employeeSkillMatrix.nonSAPSkills}"/>
					
	 			 </h:panelGrid>
		      </p:panel>   
	      			
	 		  <p:panel header="Experience">  
	 			 <h:panelGrid columns="3" cellspacing="8" columnClasses="employeeDetailLabel,gridCellMiddleLeftAligned, employeeDetailText">
		       		
		       		<h:outputLabel value="SAP Experience" />
		       		<h:outputLabel value=":"/>	
		       		<h:outputLabel value="#{viewEmployeeSkillsBean.employeeSkillMatrix.sapExperience}"  />	       							 
					
					<h:outputLabel value="SAP End User Experience" />	
					<h:outputLabel value=":"/>			
					<h:outputLabel value="#{viewEmployeeSkillsBean.employeeSkillMatrix.sapEndUserExperience}" /> 
					
					<h:outputLabel value="Non-SAP /Domain Experience " />
					<h:outputLabel value=":"/>				
					<h:outputLabel value="#{viewEmployeeSkillsBean.employeeSkillMatrix.nonSAPExperience}" /> 
					
					<h:outputLabel value="Total Experience" />
					<h:outputLabel value=":"/>
					<h:outputLabel value="#{viewEmployeeSkillsBean.employeeSkillMatrix.totalExperience}" />
					
			     </h:panelGrid>
			  </p:panel>  
 			
	 		  <p:panel header="SAP Certifications - SAP/Non-SAP Additional Skills">	         
				 <h:outputText value="SAP Certifications" styleClass="outputTextSubTitle" /><br />
				  <p:dataTable value = "#{viewEmployeeSkillsBean.sapCertifications}" var = "row" >  									
						<p:column  headerText="Certification Name" >
			                 <h:outputText value="#{row.certificationName}" />
						</p:column>					
						<p:column headerText="Version">
				             <h:outputText  value="#{row.version}"/>
						</p:column>
						<p:column headerText="Description">
				             <h:outputText value="#{row.certificationDescription}" />
						</p:column>					
			     </p:dataTable><br /><br />
			     <h:outputText value="SAP/Non-SAP Additional Skills" styleClass="outputTextSubTitle" /><br />
				 <p:dataTable value = "#{viewEmployeeSkillsBean.additionalSAPSkills}" var="additioanlSkill" >									
						<p:column  headerText="Additional Skill" >
				             <h:outputText value="#{additioanlSkill.additionalSkill}" />
						</p:column>					
						<p:column headerText="No of Projects">
				             <h:outputText  value="#{additioanlSkill.noOfProject}"/>
						</p:column>
						<p:column headerText="Description">
				             <h:outputText value="#{additioanlSkill.skillDescription}" />
						</p:column>
			     </p:dataTable> 			     		
			  </p:panel> 
			
		</h:panelGrid>
		
		</p:scrollPanel>  
		<p:commandButton id="closeButton" process="@this" value="Close" actionListener="#{viewEmployeeSkillsBean.dialogClose}" update="@form"/>	
	</p:dialog>	
         
   </p:panel>
          
		</h:form>
	</ui:define>
</ui:composition>

